package org.grayrabbit.cms.publish.api;

import java.io.ByteArrayOutputStream;
import java.util.List;

import org.grayrabbit.cms.entity.Admin;
import org.grayrabbit.cms.entity.Category;
import org.grayrabbit.cms.entity.Content;
import org.grayrabbit.cms.entity.PublishLog;
import org.grayrabbit.cms.entity.PublishTask;
import org.grayrabbit.cms.entity.Site;
import org.grayrabbit.cms.entity.Survey;
import org.grayrabbit.cms.entity.Topic;
import org.grayrabbit.cms.vo.content.ContentBean;

public interface Generatable {
	public void genreate(Admin admin,Site site,String genType,List<String> targets,int pageSize,int pageNum,PublishTask publishTask) throws Exception;
	
	public ByteArrayOutputStream preview(Site site,String genType,List<String> targetIds,Admin currentAdmin) throws Exception;

	public List<String> findCatIdsBySiteId(List<String> list,int currentCatIndex, int max);

	public int countCatBySites(List<String> targets);

	public int countTopicBySites(List<String> targets);

	public int countContentBySites(List<String> targets);

	public int countSurveyBySites(List<String> targets);

	public List<String> findTopicIdsBySiteId(List<String> list,int currentTopicIndex, int max);

	public List<String> findContentIdsBySiteId(List<String> list,int currentContentIndex, int max);

	public List<String> findMoreContentIdsBySiteId(List<String> list,int currentContentIndex, int max);

	public List<String> findSurveyIdsBySiteId(List<String> list,int currentSurveryIndex, int max);

	public int countMoreCatBySites(List<String> targets);

	public int countMoreTopicBySites(List<String> targets);

	public int countMoreContentBySites(List<String> targets);

	public List<String> findContentIdsByCatId(List<String> list,	int currentContentIndex, int max);

	public List<String> findMoreContentIdsByCatId(List<String> list,	int currentContentIndex, int max);

	public int countContentByCats(List<String> targets);

	public int countMoreContentByCats(List<String> targets);

	public List<String> findContentIdsByTopicId(List<String> list,int currentContentIndex, int max);

	public int countContentByTopics(List<String> targets);

	public int countMoreContentByTopics(List<String> targets);

	public List<String> findMoreContentIdsByTopicId(List<String> list,int currentContentIndex, int max);

	public Site getSite(String siteId);

	public Category getCategory(String catId);

	public String getParentPath(Category obj);

	public List<Content> findAllByPublish(ContentBean contentBean, int i);


	public Content getContent(String contentId);

	public Topic getTopic(String topicId);

	public Survey getSurvey(String surveyId);


	public Category loadCategory(String catId);

	public void savePublishLog(PublishLog publishLog);

	public void savePublishTask(PublishTask publishTask);
	
	public void saveContent(Content content,Admin user,String cflag);
}
